package oop4;

import java.util.Scanner;

/**
 * @author oldliu
 * @since 1.0
 */
public class Ex1 {
    public static void main(String[] args) {
        String[] a = {"a", "b", "c", "d", "1", "2", "3", "4", "5"};
        Scanner in = new Scanner(System.in);
        for (String t : a) {
            System.out.print(t + "\t");
        }
        System.out.print("你要删除哪个字符串：");
        String m = in.next();
        int i;
        for (i = 0; i < a.length - 1; i++) {
            if (a[i].equals(m)) {
                for (int j = i; j < a.length - 1; j++) {
                    a[j] = a[j + 1];
                }

                a[a.length - 1] = null;
                break;

            }

        }

        for (String t : a) {
            System.out.print(t + "\t");
        }
    }
}
